﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using System.Diagnostics;

[assembly: UITestExtensionPackageAttribute("Simple Ajax MaskedEditExtender CodedUITest Package", typeof(JSC.Projects.VisualStudio.TestTools.UITest.Extension.AjaxMaskedEditExtender.ExtensionPackage))]

namespace JSC.Projects.VisualStudio.TestTools.UITest.Extension.AjaxMaskedEditExtender
{
    /// <summary>
    /// This extension package makes it possible to Record and Playback controls who are extended with the
    /// MaskedEditExtender from the AjaxControlToolkit. Currently only Dutch dates work.
    /// </summary>
    public class ExtensionPackage : UITestExtensionPackage
    {
        private AjaxMaskEditExtenderUIPropertyProvider _provider = new AjaxMaskEditExtenderUIPropertyProvider();

        public override void Dispose()
        {
            /// There is nothing to dispose
        }

        public override object GetService(Type serviceType)
        {
            /// If the CUIT engine loads up and askes for who want to participate as an UITestPropertyProvider return
            /// your own previously instanciated UITestPropertyProvider
            if (serviceType == typeof(Microsoft.VisualStudio.TestTools.UITesting.UITestPropertyProvider))
            {
                Trace.WriteLine("MaskedEditExtenderPackage loaded");
                return _provider;
            }
            return null;
        }

        public override string PackageDescription
        {
            get { return "Simple Ajax MaskedEditExtender CodedUITest Package"; }
        }

        public override string PackageName
        {
            get { return "MaskedEditExtenderPackage"; }
        }

        public override string PackageVendor
        {
            get { return "JSC.Projects"; }
        }

        public override Version PackageVersion
        {
            get { return new Version("1.0.0.0"); }
        }

        public override Version VSVersion
        {
            get { return new Version("1.0.0.0"); }
        }
    }
}
